<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>users</title>
    <style>
        li{
            list-style: none;
        }
        #usert li{
            display: flex;
            flex-direction: row;
        }
        #usert li div{
            width: 120px;
            border: 1px dashed gainsboro;
        }
    </style>
</head>
<body>
  <h1>用户列表</h1>
<ul id="usert">
    <li>
        <div class="c1">编号</div>
        <div class="c1">姓名</div>
        <div class="c1">密码</div>
    </li>
</ul>
<script>
    fetch("myschool/findUsers").then(response=>{
        return response.json();//数据转换成json
    }).then(data=>{
        console.log(data);
        //let obj=document.querySelector("#usert");
        let obj=document.getElementById("usert");
        data.forEach(x=>{
            //obj.appendChild("<li><div>"+x.id+"</div><div>"+x.name+"</div><div>"+x.pass+"</div></li>")
           obj.innerHTML+="<li><div>"+x.id+"</div><div>"+x.name+"</div><div>"+x.pass+"</div></li>";

        });
    });
</script>
</body>
</html>